package com.yzh.design.demo.web;

import com.yzh.design.demo.annotation.DoDoor;
import com.yzh.design.demo.domain.UserInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
public class HelloWorldController {
    @Value("${server.port}")
    private int port;
    @DoDoor(key = "userId", returnJson = "{\"code\":\"1111\",\"info\":\"非白名单可访问用户拦截！\"}")
    @GetMapping("/api/queryUserInfo")
    public UserInfo queryUserInfo(String userId) {
        return new UserInfo("yzh：" + userId, 19, "东北石油大学4606");
    }
}
